//! @Author: DengLibin 榆霖
//! @Date:  2022-04-19 15:47:05
//! @Description: 
use common::date;
#[test]
pub fn test_get_timestamp_millis(){
    println!("{}", date::get_sys_timestamp_millis());
    println!("{}", date::get_chrono_timestamp_millis());
    println!("{}", date::get_chrono_local_now_time_str());
    println!("{}", date::get_chrono_local_now_year());
    println!("{}", date::get_chrono_local_now_month());
    println!("{}", date::get_chrono_local_now_day());
    let (year, month, day) = date::get_chrono_now_year_month_day();
    println!("{},{},{}",year, month, day );

    println!("------------------时间戳转日期-------------------");
    println!("{}", date::timstamp2datetime(1650384334));
    let r = date::timestr2date("2022-04-19 16:05:34"); //1650384334000
    match r {
        Ok(t) =>{println!("{}", t)},
        Err(e) => {println!("错误:{}", e)}
    }
    let sec = date::add_day(1650384334, 3);
    println!("{}", date::timstamp2datetime(sec/1000));

}